package cn.xingchen.xiangqin.service.impl;

import java.util.List;

import cn.xingchen.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.xingchen.xiangqin.mapper.XiangqinMemberMapper;
import cn.xingchen.xiangqin.domain.XiangqinMember;
import cn.xingchen.xiangqin.service.IXiangqinMemberService;

/**
 * 会员信息Service业务层处理
 * 
 * @author 爱喝茶的耀哥
 * @date 2023-04-30
 */
@Service
public class XiangqinMemberServiceImpl implements IXiangqinMemberService 
{
    @Autowired
    private XiangqinMemberMapper xiangqinMemberMapper;

    /**
     * 查询会员信息
     * 
     * @param id 会员信息主键
     * @return 会员信息
     */
    @Override
    public XiangqinMember selectXiangqinMemberById(Long id)
    {
        return xiangqinMemberMapper.selectXiangqinMemberById(id);
    }

    /**
     * 查询会员信息列表
     * 
     * @param xiangqinMember 会员信息
     * @return 会员信息
     */
    @Override
    public List<XiangqinMember> selectXiangqinMemberList(XiangqinMember xiangqinMember)
    {
        return xiangqinMemberMapper.selectXiangqinMemberList(xiangqinMember);
    }

    /**
     * 新增会员信息
     * 
     * @param xiangqinMember 会员信息
     * @return 结果
     */
    @Override
    public int insertXiangqinMember(XiangqinMember xiangqinMember)
    {
        xiangqinMember.setCreateTime(DateUtils.getNowDate());
        return xiangqinMemberMapper.insertXiangqinMember(xiangqinMember);
    }

    /**
     * 修改会员信息
     * 
     * @param xiangqinMember 会员信息
     * @return 结果
     */
    @Override
    public int updateXiangqinMember(XiangqinMember xiangqinMember)
    {
        xiangqinMember.setUpdateTime(DateUtils.getNowDate());
        return xiangqinMemberMapper.updateXiangqinMember(xiangqinMember);
    }

    /**
     * 批量删除会员信息
     * 
     * @param ids 需要删除的会员信息主键
     * @return 结果
     */
    @Override
    public int deleteXiangqinMemberByIds(Long[] ids)
    {
        return xiangqinMemberMapper.deleteXiangqinMemberByIds(ids);
    }

    /**
     * 删除会员信息信息
     * 
     * @param id 会员信息主键
     * @return 结果
     */
    @Override
    public int deleteXiangqinMemberById(Long id)
    {
        return xiangqinMemberMapper.deleteXiangqinMemberById(id);
    }
}
